<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <title>{{ rows['title'] }}</title>
    <link rel="stylesheet" href="{{ LAYUI_PATH }}layui/css/layui.css" media="all">
</head>
<body>
<div class="layui-fluid">
    <div class="layui-card">
        <div class="layui-card-body" style="padding: 15px;">
            <!--任务标题-->
            <div class="layui-form-item">
                <div class="layui-inline">
                    <strong style="font-size:15px;">任务标题：</strong>
                    <span title="{{ rows['title'] }}">{{ rows['title'] }}</span>
                </div>
            </div>

            <!--任务所属分类-->
            <div class="layui-form-item">
                <div class="layui-inline">
                    <strong style="font-size:15px;">所属分类：</strong>
                    <span title="{{ rows['source'] }}">{{ rows['source'] }}</span>
                </div>
            </div>

            <!--任务状态-->
            <div class="layui-form-item">
                <div class="layui-inline">
                    <strong style="font-size:15px;">任务状态：</strong>
                    {% if rows.get('status') == 1 %}
                        <span title="进行中" class="layui-badge layui-bg-green">进行中</span>
                    {% elif rows.get('status') == 2 %}
                        <span title="已暂停" class="layui-badge layui-bg-orange">已暂停</span>
                    {% elif rows.get('status') == 3 %}
                        <span title="已停止" class="layui-badge layui-bg-badge">已停止</span>
                    {% elif rows.get('status') == 4 %}
                        <span title="已结束" class="layui-badge layui-bg-badge">已结束</span>
                    {% elif rows.get('status') == 5 %}
                        <span title="已超时" class="layui-badge layui-bg-badge">已超时</span>
                    {% else %}
                        <span title="未知??" class="layui-badge layui-bg-blue">未知??</span>
                    {% endif %}
                </div>
            </div>

            <!--任务等级-->
            <div class="layui-form-item">
                <div class="layui-inline">
                    <strong style="font-size:15px;">任务等级：</strong>
                    {% if rows.get('level') == 1 %}
                        <span title="Lv1黄界" class="layui-badge layui-bg-blue">Lv1黄界</span>
                    {% elif rows.get('level') == 2 %}
                        <span title="Lv2玄界" class="layui-badge layui-bg-green">Lv2玄界</span>
                    {% elif rows.get('level') == 3 %}
                        <span title="Lv3地界" class="layui-badge layui-bg-orange">Lv3地界</span>
                    {% elif rows.get('level') == 4 %}
                        <span title="Lv4天界" class="layui-badge layui-bg-badge">Lv4天界</span>
                    {% else %}
                        <span title="未定义" class="layui-badge layui-bg-badge">未定义</span>
                    {% endif %}
                </div>
            </div>

            <!--参与者-->
            <div class="layui-form-item">
                <div class="layui-inline">
                    <strong style="font-size:15px;">任务参与者：</strong>
                    {% if rows['people'] == '' %}
                        <span style="font-size:16px;">不知道为什么，居然没有参与人！！！</span>
                    {% elif rows['people'].split('|') %}
                        {% for item in rows['people'].split('|') %}
                            <span style="font-size:14px;" class="layui-badge-rim">{{ item }}</span>&nbsp;
                        {% endfor %}
                    {% endif %}
                </div>
            </div>
            {% if not rows['people'] == '' %}
                <!--参与人数-->
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <strong style="font-size:15px;">参与人数：</strong>
                        <span title="{{ rows['people'].count('|') + 1 }}">{{ rows['people'].count('|') + 1 }}</span>
                    </div>
                </div>
            {% endif %}
            <!--任务创建人-->
            <div class="layui-form-item">
                <div class="layui-inline">
                    <strong style="font-size:15px;">创建人：</strong>
                    <span title="{{ rows['found'] }}">{{ rows['found'] }}</span>
                </div>
            </div>

            <!--任务说明-->
            <div class="layui-form-item">
                <div class="layui-inline">
                    <strong style="font-size:15px;">任务说明：</strong>
                    <pre title="{{ rows['explain'] }}">{{ rows['explain'] }}</pre>
                </div>
            </div>

            <!--任务开始时间-->
            <div class="layui-form-item">
                <div class="layui-inline">
                    <strong style="font-size:15px;">任务开始时间：</strong>
                    <span title="{{ timestampTodatetime(rows['starttime']) }}">{{ timestampTodatetime(rows['starttime']) }}</span>
                </div>
            </div>

            <!--在线文档-->
            <div class="layui-form-item">
                <div class="layui-inline">
                    <strong style="font-size:15px;">在线文档：</strong>
                    <span class="layui-badge layui-bg-blue" title="在线文档"><a style="color:#ffffff;font-size:15px" onclick="parent.window.open('/project/go/{{ rows['uuid'] }}');" href="javascript:;">点我进入在线文档</a></span>
                </div>
            </div>
        </div>
    </div>
</div>


<script src="{{ LAYUI_PATH }}layui/layui.all.js"></script>
<script>
    if (self === top) {
        let layid = parent.layer.confirm('检测到你被重定向到了单独页面，是否回到主页面？', function () {
            window.location.href = '/';
            parent.layer.close(layid);
        })
    }
</script>
</body>
</html>